from appium import webdriver
device_cap={}
device_cap["platformName"]= "Android"
device_cap["platformVersion"]= "7.1.2"
device_cap["deviceName"]= "127.0.0.1:62001"
device_cap["appPackage"]="com.android.settings"
device_cap["appActivity"]=".Settings"

driver= webdriver.Remote("http://127.0.0.1:4723/wd/hub",device_cap)

driver.quit()